<!-- /* Description for file.
 * 机构定制
 * @copyright     Copyright 2008-2010, PHInfo Services Inc. (http://www.phinfoservices.com)
 * @package       ues
 * @subpackage    ues/app/views/organs
 * @since         ues
 * @version       V0.0.1
 * @modifiedby    张海杰2011年0625
 * @lastmodified  张海杰2011年0625
 */
 -->

<?php
echo $html->css ( 'style' );
echo $html->css ( 'tab' );
echo $javascript->link ( 'jquery' );
?>

<script type="text/javascript">
	function getDelStr() {
		var delArr = $("#OrganDeleteSomeForm :checkbox:checked");
		if(delArr.length==0)
		{
			alert("请选择你要删除的项!");
			return;
		}
		if(!confirm("确定删除?"))
		{
			return;
		}
		var str = "";
		for(var i=0;i<delArr.length;i++) {
			var del = delArr[i].value;
			str += del;
			str += "/";
		}
		$("#delStr").val(str);
		$("#OrganDeleteSomeForm").submit();
	}
	
	$(document).ready(function() { 
		$("#checkedAll").click(function() { 
			if ($(this).attr("checked") == true) { // 全选 
				$("input[name='checkbox_name']").each(function() { 
				$(this).attr("checked", true); 
				}); 
			} else { // 取消全选 
				$("input[name='checkbox_name']").each(function() { 
				$(this).attr("checked", false); 
				}); 
			} 
		});  
	// 查询时局部刷新//	
	// 查询时局部刷新//	
	$("#btnajaxSearch").click(function(){
		$("#reloadpart").load(
				'<?php echo ROOT_WEB_PATH; ?>/organs/query/  #reloadpart',
				{ "name":$('#OrganName').val()},
				function(){
					$("#checkedAll").click(function() {
						if ($(this).attr("checked") == true) { // 全选 
						$("input[name='checkbox_name']").each(function() { 
						$(this).attr("checked", true); 
						}); 
						} else { // 取消全选 
						$("input[name='checkbox_name']").each(function() { 
						$(this).attr("checked", false); 
						}); 
						} 
						}); 
					});		
});
});

</script>

<!-- 当前位置-->
<div id="tabmenubar">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td class="tabmenubartitle1"><?php echo  __('YourPosition');//您现在的位置：?></td>
		<td class="tabmenubartitle2"><?php echo __('Systemconfigs');//一级目录
										   echo '>';echo __('Othersetting');//二级目录
										   echo '>';?>
									<?php echo $html->tag('span', __('Organs',true).__('department',true));//当前操作地用span加粗?> 						  
		</td>
	</tr>
</table>
</div>
<!-- 当前位置-->

<?php echo $form->create('Organ',array('action'=>'deleteSome','type'=> 'post'));?>
<?php echo $form->hidden('delStr',array('name'=>'organsid','id'=>'delStr'));?>

<div class="tabflex">
<fieldset><legend><?php __('Organs');?></legend>
<table width="100%" cellspacing="0" cellpadding="0" border="0"
	style="text-align: left">
	<tr>
		<td width="50"></td>
		
		<td width="100"><?php __('OrgansName');?>:</td>
		<td ><?php echo $form->text('name',array('class' => 'TextBoxL txtOut')); ?></td>
		<td width="40px">
		<a><?php echo $html->image('search.gif', array('alt' =>  __('Search', true),'border'=>'0','id'=>'btnajaxSearch' ));?> </a>		
		<!-- __('Search', true)查询--></td>
		<td width="40px">
		<?php echo $html->link( $html->image('add.gif', array('alt' =>  __('Add', true),'border'=>'0')), 
			'/organs/add/', null,null,array('escape'=>false));  ?> 	
		<!-- __('Add', true)增加--></td>
		<td width="40px">
		<a><?php echo $html->image('delete.gif', array('alt' =>  __('Delete', true),'border'=>'0','onclick'=>'getDelStr()'));?></a>
		</td>
		<!--  __('delete', true) 删除、提示 -->

	</tr>
</table>
</fieldset>
</div>

<!-- 机构列表 -->
<div id="reloadpart">				
<div id="nav1" style="width:97%">			
<table width="100%" cellpadding="0" cellspacing="0" class="tab1">
	<tr>
		<th width="70px"><?php echo $form->checkbox('',array('id'=>'checkedAll'));?></th>
		<th ><?php echo __('OrgansName');//机构名称?></th>
		<th ><?php echo __('OrgansManage');//机构负责人?></th>
		<th ><?php echo __('OrgansDescription');//机构描述?></th>
		<th width="40px"><?php echo __('Operate');//修改?></th>
	</tr>
	<!-- Here's where we loop through our $Notes array, printing out post info --> 
	
	<?php 
	foreach ($organList as $data):
	?>
		<tr class=normal onmouseover='this.className= "over " '
			onmouseup='this.className= "over " '
			onmouseout='this.className= "normal " ' id="search">
		<td>
			<!-- 批量删除选择 -->				
			<?php echo $form->checkbox($data['Organ']['id'], array('value' => $data['Organ']['id'],'name'=>'checkbox_name'));?>
		</td>
		<td title="<?php echo $data['Organ']['name']; ?>">
			<?php echo $data['Organ']['name']; ?>
		</td>
		<td title="<?php echo $data['Organ']['manage']; ?>">
			<?php echo $data['Organ']['manage']; ?>
		</td>
		<td title="<?php echo $data['Organ']['description']; ?>">
			<?php echo $data['Organ']['description']; ?>
		</td>
		<td width="40px">
			<?php echo $html->link( $html->image('edit.gif', array('alt' =>  __('Edit', true),'border'=>'0')), 
			'/organs/edit/' . $data['Organ']['id'], null,null,array('escape'=>false));  ?> 
				 <!-- __('Edit', true) 修改-->
		</td>
		</tr> 
	<?php endforeach; ?>
</table>
</div>
</div>

<!-- 机构列表列表 -->
<?php echo $form->end();?>

<iframe name="dept" height="720" width="100%" border="0" frameborder="0"  scrolling="no"
src="<?php echo $html->url(array( "controller" => "departments","action" => "init"));?>">
			浏览器不支持嵌入式框架，或被配置为不显示嵌入式框架。
</iframe>




